package gemini.castor.ui.server.service.impl;

import gemini.basic.manager.ProductManager;
import gemini.basic.model.ProductType;
import gemini.castor.ui.client.service.ProductTypeService;
import gemini.castor.ui.server.service.AbstractSingleService;

import java.util.ArrayList;
import java.util.List;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;

public class ProductTypeServiceImpl extends
        AbstractSingleService<ProductManager> implements
        ProductTypeService {

    @SuppressWarnings("unused")
	private final Log logger = LogFactory
            .getLog(ProductTypeServiceImpl.class);

	@Override
	public ArrayList<ProductType> getAllCategory() {
		List<ProductType> resultList = getServerManager().getAllCategory();
		ArrayList<ProductType> result = null;
		
		if(resultList != null){
			result = new ArrayList<ProductType>(resultList.size());
			for (ProductType proType : resultList) {
				result.add(duplicateExcludeFields(proType));
			}
		}
		return result;
	}
}
